package com.woniuxy.creditsystem.loanmag.controller;

import com.woniuxy.creditsystem.common.bean.Detail;
import com.woniuxy.creditsystem.loanmag.service.LoanService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

@RequestMapping("/detail")
@Controller
public class DetailController {
    @Resource
    private LoanService loanService;
    @RequestMapping("getrow")
    public String getdetail(String orderid, Model model){
        System.out.println(orderid);
        //拿着订单编号去查询详情信息；
        Detail detail = loanService.findByorderid(orderid);
        System.out.println(detail);
        //将对象添加到model
        model.addAttribute("bean",detail);
        //转发至详情页
        return "loanmag/detailpage";
    }


}
